/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.quician.webapp.controllers;

import java.io.Serializable;
import java.util.Locale;
import javax.enterprise.context.RequestScoped;
import javax.faces.context.FacesContext;
import javax.inject.Named;

/**
 *
 * @author quician
 */
@Named(value="MainController")
@RequestScoped
public class MainController implements Serializable{
    private static final long serialVersionUID = 1L;
    
    
    
    public void ChangeLenguage(){
        if(FacesContext.getCurrentInstance().getViewRoot().getLocale().equals(new Locale("en")))
            FacesContext.getCurrentInstance().getViewRoot().setLocale(new Locale("es")); 
        else
            FacesContext.getCurrentInstance().getViewRoot().setLocale(new Locale("en")); 
    }
    
}
